// Defines some helper opengl functions
#ifndef GL_HPP
#define GL_HPP

#ifdef WIN32
# ifndef NOMINMAX
#  define NOMINMAX
# endif
#  include <windows.h>
#  include <GL/gl.h>
#else
#  include <GL/gl.h>
#endif

#include "Color.hpp"
#include "Vec3.hpp"
#include <cassert>

class Mat4;
class Mat3;
class Vec2;
class Vec3;
namespace gl
{
   inline void AssertGlError() 
   { 
      int errorNumber = glGetError();
      if (errorNumber != GL_NO_ERROR)
      {
         assert(!"Received GL ERROR"); 
      }
   }
   void Multiply(const Mat4& aMat);
   void Multiply(const Mat3& aMat);
   void Translate(const Vec3& aVec);
   void Vertex(const Vec3& aMat);
   void Vertex(const Vec2& aMat);
   void Vertex(const Vec2& aMat, float aZ);
   void Vertex(const std::vector<Vec3>& aVerts);
   inline void Normal(const Vec3& aVec) { glNormal3fv(&aVec.x); }
   class NoDepthTest
   {
   public:
      NoDepthTest();
      ~NoDepthTest();
   };
   class NoLighting
   {
   public:
      NoLighting();
      ~NoLighting();
   };
   
   class ZOffset
   {
   public:
      ZOffset();
      ~ZOffset();
   };

   class NoCull
   {
   public:
      NoCull();
      ~NoCull();
   };
   class Blend
   {
   public:
      Blend();
      ~Blend();
   };
}
#endif
